/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Library General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301,  USA
 */

/**
 * @version conf.h 0.0.2
 * @author Dr.NP <np@bsgroup.org>
 * @package Comor
 *
 * Configuration parser header
 */

/* BEGIN OF CONSTANTS */
#define MAX_CONF_LINE_LENGTH		32767
#define DEFAULT_CONFIG_FILE			"/etc/bspd.conf"
/* END OF CONSTANTS */

/* BEGIN OF STRUCTS */
// Key => value
struct param
{
	char			*key;
	char			*value;
};

// Configuration
struct conf
{
	char			*srv_mode;
	char			srv_daemonize;
	char			srv_enable_thread;
	int				srv_worker;
	
	char			*base_srv_addr;
	char			*base_srv_listen_addr;
	int				base_srv_port;
	
	char			*center_srv_addr;
	char			*center_srv_listen_addr;
	int				center_srv_port;
	
	char			*status_srv_listen_addr;
	int				status_srv_port;

	char			*login_srv_addr;
	char			*login_srv_listen_addr;
	int				login_srv_port;
	int				login_srv_status_port;

	char			*coin_srv_listen_addr;
	int				coin_srv_port;
	
	char			*srv_sandbox_str;
	
	char			*mysql_host;
	char			*mysql_user;
	char			*mysql_pass;
	char			*mysql_default_db;
	char			*mysql_sock;
	
	char			*mysql_user_table;
	char			*mysql_uid_column;
	char			*mysql_uname_column;
	char			*mysql_upass_column;
	char			*mysql_urid_column;
	char			*mysql_ucoin_column;

	char			*mysql_runner_table;
	char			*mysql_rid_column;
	char			*mysql_rname_column;
	char			*mysql_rscript_column;
	char			*mysql_rlogin_column;

	char			*mysql_banker_table;
	char			*mysql_bid_column;
	char			*mysql_bpass_column;
	char			*mysql_brid_column;
	char			*mysql_blevel_column;
	char			*mysql_bamount_column;

	int				base_status_interval;
	char			*log_filename;
	char			*runner_base_dir;
	char			*status_file_dir;
};
/* END OF STRUCTS */

/* BEGIN OF FUNCTIONS */
int conf_init(char *);
int conf_parse_line(char *);
int conf_eval();
/* END OF FUNCTIONS */
